package com.example.demo.service.impl;

public class RunableTask implements Runnable {

		@Override
		public void run() {
			// TODO 自动生成的方法存根
			 synchronized (this){
		            try {
		                for (int i = 1;i <= 100;i++){
		                   System.out.println(Thread.currentThread().getName()+"----------异步：>"+i);
		                    this.wait(200);
		                }
		                System.out.println( "执行异步任务完毕");
		            }catch (Exception ex){
		                ex.printStackTrace();
		            }
		        }
		        System.out.println( Thread.currentThread().getName()+"执行完毕");
		}	
}
